package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.model.ContractCompareModel;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import com.xbongbong.saas.domain.dao.ContractCompareDao;
import com.xbongbong.saas.domain.entity.ContractCompareEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author bomfish
 */
@Service("contractCompareModel")
public class ContractCompareModelImpl implements ContractCompareModel {
    @Resource
    private ContractCompareDao contractCompareDao;

    @Override
    public Long insert(ContractCompareEntity entity) {
        long now = DateTimeUtil.getInt();
        entity.setAddTime(now);
        entity.setUpdateTime(now);
        return contractCompareDao.insert(entity);
    }

    @Override
    public void insertBatch(List<ContractCompareEntity> list) {
        contractCompareDao.insertBatch(list);
    }

    @Override
    public List<ContractCompareEntity> findEntities(Map<String, Object> param) {
        return contractCompareDao.findEntities(param);
    }

    @Override
    public Integer getEntityCount(Map<String, Object> param) {
        return contractCompareDao.getEntitiesCount(param);
    }

    @Override
    public void update(ContractCompareEntity entity) {
        contractCompareDao.update(entity);
    }

    @Override
    public ContractCompareEntity getByKey(Long key, String corpid) {
        return contractCompareDao.getByKey(key, corpid);
    }

}
